import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/common/home.vue'
import login from '@/components/login/login.vue'

import carList from '@/components/car/carList.vue'
import subCarList from '@/components/car/subCarList.vue'
import carOrderDetial from '@/components/car/carOrderDetial'
import carSaleDetial from '@/components/car/carSaleDetial'

import sales from '@/components/sales/salesData.vue'
import sales_add from '@/components/sales/addSales.vue'
import marketList from '@/components/market/marketList.vue'
import marketForm from '@/components/market/marketForm.vue'
import shopList from '@/components/shop/shopList.vue'
import shopForm from '@/components/shop/shopForm.vue'
import regionList from '@/components/region/regionList.vue'
import regionForm from '@/components/region/regionForm.vue'
import contractList from '@/components/contract/contractList.vue'
import addContractForm from '@/components/contract/addContractForm.vue'
import updateContractForm from '@/components/contract/updateContractForm.vue'
import userList from '@/components/user/userList.vue'
import userForm from '@/components/user/userForm.vue'
import staffList from '@/components/staff/staffList.vue'
import staffForm from '@/components/staff/staffForm.vue'
import noticeList from '@/components/notice/noticeList.vue'
import noticeForm from '@/components/notice/noticeForm.vue'
import rotationList from '@/components/rotation/rotationList.vue'
import rotationForm from '@/components/rotation/rotationForm.vue'

import insertgate from '@/components/gate/insertGate.vue'
import addgate from '@/components/gate/addGate.vue'
import finance from '@/components/finance/finance.vue'
import editPassword from '@/components/edit/password.vue'
import testing from '@/components/testing/testing.vue'

import carDetial from '@/components/car/carDetial.vue'

import carAdd from '@/components/car/carAdd.vue'
import carEdit from '@/components/car/carEdit.vue'

import banner from '@/components/banner/banner.vue'
import banner_add from '@/components/banner/increaseBanner.vue'

import deleteCar from '@/components/system/deletecar.vue'
import deleteActualCar from '@/components/system/deleteActualCar.vue'

import versionList from '@/components/version/versionList.vue'
import versionForm from '@/components/version/versionForm.vue'

import pictureList from '@/components/picture/pictureList.vue'
import pictureForm from '@/components/picture/pictureForm.vue'

import intentionList from '@/components/intention/intentionList.vue'
import intentionForm from '@/components/intention/intentionForm.vue'

// 申请入库
import carInStock from '@/components/car/carInStock'
// 车辆预定
import carOrderAdd from 'comp/car/carOrder'
// 销售出库
import carSaleAdd from 'comp/car/carSale'


import reviewList from '@/components/source/sourceList.vue'
import reviewForm from '@/components/source/souceForm.vue'

import dataStatic from '@/components/index/dataStatistics'
import section1 from '@/components/index/section1/index.vue'
import section2 from '@/components/index/section2/index.vue'
import section3 from '@/components/index/section3/index.vue'
import section4 from '@/components/index/section4/index.vue'
import section5 from '@/components/index/section5/index.vue'
Vue.use(Router);

export default new Router({
  routes: [
    {
      path:'/',
      redirect: '/car'
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    { path: '/section1', name: 'section1', component: section1 },
    { path: '/section2', name: 'section2', component: section2 },
    { path: '/section3', name: 'section3', component: section3 },
    { path: '/section4', name: 'section4', component: section4 },
    { path: '/section5', name: 'section5', component: section5 },
    {
      path:'/car',
      component:home,
      meta: [{name:'首页 ',path:'/car',requiresAuth:true}],
      children:[
        {
          path: '/dataStatic',
          name: 'dataStatic',
          component: dataStatic,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'数据展示 ',path:'/dataStatic',requiresAuth:true}]
        },
        {
          path: '/car',
          name: 'carList',
          component: carList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true}]
        },
        {
          path: '/car/carInStock/:id',
          name: 'carInStock',
          component: carInStock,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'申请入库',path:'/car/carInStock/:id',requiresAuth:true}]
        },
        {
          path: '/car/carDetial/:id',
          name: 'carDetial',
          component: carDetial,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'车辆详情',path:'/car/carDetial/:id',requiresAuth:true}]
        },
        {
          path: '/car/carEdit/:id',
          name: 'carEdit',
          component: carEdit,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'车辆编辑',path:'/car/carEdit/:id',requiresAuth:true}]
        },
        {
          path: '/car/carOrderAdd/:id',
          name: 'carOrderAdd',
          component: carOrderAdd,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'车辆预定',path:'/car/carOrderAdd/:id',requiresAuth:true}]
        },
        {
          path: '/car/carOrder/:id',
          name: 'carOrderDetial',
          component: carOrderDetial,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'预定信息',path:'/car/carStock/:id',requiresAuth:true}]
        },
        {
          path: '/car/carSaleAdd/:id',
          name: 'carSaleAdd',
          component: carSaleAdd,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'销售出库',path:'/car/carSaleAdd/:id',requiresAuth:true}]
        },
        {
          path: '/car/carSale/:id',
          name: 'carSaleDetial',
          component: carSaleDetial,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车辆列表 ',path:'/car',requiresAuth:true},{name:'销售信息',path:'/car/carSale/:id',requiresAuth:true}]
        },
        {
          path: '/car/carAdd',
          name: 'carAdd',
          component: carAdd,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增车辆',path:'/car/carAdd',requiresAuth:true}]
        },
        {
          path:'/sales',
          component:sales,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'销售数据 ',path:'/sales',requiresAuth:true}],
          children: [
            {path: '/sales/:id', component: sales_add, meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增数据 ',path:'/sales/:id',requiresAuth:true}],}
          ]
        },
        {
          path:'/finance',
          component:finance,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'金融线索',path:'/sales',requiresAuth:true}]
        },
        {
          path: '/banner',
          component: banner
        },
        {
          path:'/insertgate',
          component:insertgate,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'道闸出入信息 ',path:'/insertgate',requiresAuth:true}]
        },
        {
          path:'/addgate',
          component:addgate,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'道闸信息 ',path:'/addgate',requiresAuth:true}]
        },
        {
          path:'/testing',
          component:testing,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'检测单列表 ',path:'/testing',requiresAuth:true}]
        },
        {
          path: '/market/marketList',
          component: marketList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'市场列表 ',path:'/market/marketList',requiresAuth:true}]
        },
        {
          path: '/market/marketForm',
          component: marketForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增市场 ',path:'/market/marketForm',requiresAuth:true}]
        },
        {
          path: '/review',
          component: reviewList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:' 车辆审核列表 ',path:'/reviewList',requiresAuth:true}]
        },
        {
          path: '/review/reviewForm/:id',
          component: reviewForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:' 车辆审核详情 ',path:'/review/reviewForm',requiresAuth:true}]
        },
        {
          path: '/market/marketForm/:id',
          component: marketForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'市场列表 ',path:'/market/marketList',requiresAuth:true},{name:'市场编辑',path:'/market/marketForm/:id',requiresAuth:true}]
        },
        {
          path: '/shop/shopList',
          component: shopList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车商列表 ',path:'/shop/shopList',requiresAuth:true}]
        },
        {
          path: '/car/subCarList',
          component: subCarList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'车商列表 ',path:'/shop/shopList',requiresAuth:true},{name:'查看销售车辆 ',path:'/car/subCarList',requiresAuth:true}]
        },
        {
          path: '/shop/shopForm',
          component: shopForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增车商 ',path:'/shop/shopForm',requiresAuth:true}]
        },
        {
          path: '/shop/shopForm/:id',
          component: shopForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'编辑车商 ',path:'/shop/shopForm/:id',requiresAuth:true}]
        },
        {
          path:'/editPassword',
          component:editPassword,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'修改密码 ',path:'/editPassword',requiresAuth:true}]
        },
        {
          path: '/region/regionList',
          component: regionList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'区域列表 ',path:'/region/regionList',requiresAuth:true}]
        },
        {
          path: '/region/regionForm',
          component: regionForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增区域 ',path:'/region/regionForm',requiresAuth:true}]
        },
        {
          path: '/region/regionForm/:id',
          component: regionForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'区域列表 ',path:'/region/regionList',requiresAuth:true},{name:'区域编辑',path:'/region/regionForm/:id',requiresAuth:true}]
        },
        {
          path: '/contract/contractList',
          component: contractList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'合同列表',path:'/contract/contractList',requiresAuth:true}]
        },
        {
          path: '/contract/contractForm',
          component: addContractForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增合同',path:'/contract/contractForm',requiresAuth:true}]
        },
        {
          path: '/contract/contractForm/:id',
          component: updateContractForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'合同列表',path:'/contract/contractList',requiresAuth:true},{name:'合同编辑',path:'/contract/contractForm/:id',requiresAuth:true}]
        },
        {
          path: '/user/userList',
          component: userList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'人员列表',path:'/user/userList',requiresAuth:true}]
        },
        {
          path: '/user/userForm',
          component: userForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增人员',path:'/user/userForm',requiresAuth:true}]
        },
        {
          path: '/user/userForm/:id',
          component: userForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'人员列表',path:'/user/userList',requiresAuth:true},{name:'人员编辑',path:'/user/userForm/:id',requiresAuth:true}]
        },
        {
          path: '/staff/staffList',
          component: staffList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'员工列表',path:'/staff/staffList',requiresAuth:true}]
        },
        {
          path: '/staff/staffForm',
          component: staffForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增员工',path:'/staff/staffForm',requiresAuth:true}]
        },
        {
          path: '/staff/staffForm/:id',
          component: staffForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'员工列表',path:'/staff/staffList',requiresAuth:true},{name:'编辑员工',path:'/staff/staffForm/:id',requiresAuth:true}]
        },
        {
          path: '/notice/noticeList',
          component: noticeList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'公告列表',path:'/notice/noticeList',requiresAuth:true}]
        },
        {
          path: '/notice/noticeForm',
          component: noticeForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增公告',path:'/notice/noticeForm',requiresAuth:true}]
        },
        {
          path: '/notice/noticeForm/:id',
          component: noticeForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'公告列表',path:'/notice/noticeList',requiresAuth:true},{name:'编辑公告',path:'/notice/noticeForm/:id',requiresAuth:true}]
        },
        {
          path: '/banner/bannerList',
          component: banner,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'轮播图列表',path:'/banner/bannerList',requiresAuth:true}]
        },
        {
          path: '/banner/add',
          component: banner_add,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增轮播图',path:'/banner/add',requiresAuth:true}]
        },
        {
          path: '/banner/add/:id',
          component: banner_add,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'轮播图列表',path:'/banner',requiresAuth:true}]
        },
        {
          path: '/system/deleteCar',
          component: deleteCar,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'删除车辆',path:'/system/deleteCar',requiresAuth:true}]
        },
        {
          path: '/system/deleteActualCar',
          component: deleteActualCar,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'删除物理车辆',path:'/system/deleteActualCar',requiresAuth:true}]
        },
        {
          path: '/picture/pictureList',
          component: pictureList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'图片场景列表',path:'/picture/pictureList',requiresAuth:true}]
        },
        {
          path: '/picture/pictureForm',
          component: pictureForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增图片场景',path:'/picture/pictureForm',requiresAuth:true}]
        },
        {
          path: '/picture/pictureForm/:id',
          component: pictureForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'图片场景列表',path:'/picture/pictureList',requiresAuth:true},{name:'修改图片场景',path:'/picture/pictureForm',requiresAuth:true}]
        },
        {
          path: '/version/versionList',
          component: versionList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'APP版本列表',path:'/version/versionForm',requiresAuth:true}]
        },
        {
          path: '/version/versionForm',
          component: versionForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增APP版本',path:'/version/versionList',requiresAuth:true}]
        },
        {
          path: '/intention/intentionList',
          component: intentionList,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'合作意向列表',path:'/intention/intentionList',requiresAuth:true}]
        },
        {
          path: '/intention/intentionForm',
          component: intentionForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'新增合作意向',path:'/intention/intentionForm',requiresAuth:true}]
        },
        {
          path: '/intention/intentionForm/:id',
          component: intentionForm,
          meta: [{name:'首页 ',path:'/',requiresAuth:true},{name:'合作意向列表',path:'/intention/intentionList',requiresAuth:true},{name:'编辑合作意向',path:'/intention/intentionForm',requiresAuth:true}]
        }
      ]
    },


  ]
})
